<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <title>Document</title>
</head>

<body>
   <div id="app">
        <!-- 
            style的对象写法
         -->
         <div :style="{color:'red',fontSize:'30px'}">xxx</div>

         <!-- 
            我们也可以把对象书写在data中，然后直接引用
          -->
          <div :style="boxStyle">大家立刻就</div>
   </div>

   <script>
    const vm  = new Vue({
        el:"#app",
        data(){
            return{
                boxStyle:{
                    color:"pink",
                    fontSize:"40px",
                    fontWeight:"bold",
                }
            }
        }
    })
   </script>
</body>

</html>